
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no"/>
<title>S-Pet Index Page(v0.3)</title>

<link rel="stylesheet" type="text/css" href="css/defaultb.css" />
<link rel="stylesheet" type="text/css" href="css/componentb.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0-rc.1/jquery.mobile.structure-1.4.0-rc.1.min.css" /> 

<link href="1130.css" type="text/css" rel="stylesheet">

<!--<link rel="stylesheet" type="text/css" href="css/1128.css">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0-rc.1/jquery.mobile.structure-1.4.0-rc.1.min.css" /> -->


<script src="js/modernizr.customb.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="lib/jquery.mobile-1.3.2.js"></script>
	<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
	<script type="text/javascript" charset="utf-8" src="phonegap-nfc.js"></script>
	<script type="text/javascript" charset="utf-8" src="phonegap-toast.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/write.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/pic.js"></script>
    <script type="text/javascript">
	function handleOpenURL(url) {
	    alert("찾아주셔서 감사합니다.\n received url: " + url);
		if(url != ''){
			window.location.replace("http://70.12.110.62:8888/readview?i=1385347318500");
		}
	}

</script>



</head>
<body>
	<div data-role="page" id="main">
		
		<div id="header" data-role="header" data-theme="a">
			<h1>S-Pet Test v0.3</h1>
		</div>
		
		<div id="content" data-role="content">
			<div id="first"><a href="#read"><span class="text">R E A D	T A G</span></a></div>
			<div id="second"><a href="#write"><span class="text">W R I T E T A G</span></a></div>
			<div id="third"><a href="/readList"><span class="text">L O G V I E W</span></a></div>
			<div id="fourth"><a href="/sosList"><span class="text">S O S</span></a></div>
			
		</div>
		
		<!-- 메인화면 content 메뉴 -->
<!-- 		<div id="content" data-role="content">
			<img alt="Logo" src="img/logo.png">
		
			<ul data-role="listview">
				<li><a href="read.html" data-icon="arrow-r" data-iconpos="right">Read Tag</a></li>			
				<li><a href="write.html">Write Tag(태그 쓰기)</a></li>			
				<li><a href="/readList" data-transition="slide">Log View(기록 정보)</a></li>			
				<li><a href="/sosList" data-transition="slide">SOS List(실종동물)</a></li>			
				<li><a href="/camera">Camera Test</a></li>			
				<li><a href="/map">Map Test</a></li>			
			</ul>
		</div>-->
		<div data-role="footer" id="footer" data-theme="a" style="text-align : center;">
			<a href="/log" data-icon="alert">Admin</a>
		</div>		
	</div> 
<!-- 	<p>
		<button class="btn btn-5 btn-5a icon-cart"><span>Add to cart</span></button>
		<button class="btn btn-5 btn-5a icon-remove"><span>Delete</span></button>
		<button class="btn btn-5 btn-5a icon-cog"><span>Settings</span></button>
	</p> --> 












<!--  

	<div data-role="page" id="write">
		<div data-role="header" data-position="fixed">
			<a href="#main" data-icon="home" class="ui=btn-left">Home</a>
			<h1>Write TAG</h1>
			<a href="#"	data-icon="refresh">Refresh</a>
		</div>
		
		<div data-role="content" data-theme="a">
			<form method="GET">
				<h2>Tag 기입 페이지(TAG Write)</h2>
				<input type="text" id="hash" name="i"/>
				<input type="text" name="o" class="input" placeholder="주인이름(선택입력, 닉네임 가능)" value="dahee"/>
				<input type="text" name="n" class="input" placeholder="동물이름*" required="required" value="dogdog"/>
				<input type="text" name="t" class="input" placeholder="전화번호*" required="required" value="01067611144"/>
				<input type="text" name="m" class="input" placeholder="특이사항*" required="required" value="bow-wow & kkk"/>
				<input type="text" name="c" class="input" placeholder="사례정보(단위: 만원, 선택입력)" value="200"/>
				
				->
			
<!-- 				<input type="submit" value="입력완료"> -->
<!-- 			</form>
		</div>	

	<button id="write" onclick="wrt.init_w();">on</button>
	<button id="stop" onclick="wrt.stopnfc();">off</button>
				<input type="text" name="mimetype" class="input" placeholder="마임타입" required="required" value="text/spet"/>
				<input type="text" name="url" class="input" placeholder="URL*" required="required" value="http://llun.com/in"/>
				<input type="text" name="payload" class="input" placeholder="특이사항*" required="required" value="http://llun.com/in"/>

    <button class="btn large" onclick="show_pic();">사진을 업로드 하시겠소?</button>

    <div id="viewport" class="viewport" style="display:none;">
      <img style="width:300px;height:200px;" id="photo" src="" />
    </div>
</div>








<div data-role="page" id="read">
    <script id="non-ndef-template" type="text/x-handlebars-template">
        <p>Scanned a non-NDEF NFC tag</p>
        <p>
            Tag Id: <strong>{{ bytesToHexString id }}</strong>
        </p>
    </script>

    <script id="tag-template" type="text/x-handlebars-template">
        <p>Scanned an NDEF tag with {{ ndefMessage.length }} {{ pluralize ndefMessage.length 'record' 'records' }}</p>

        {{!
            BB10 and WP8 will not have any meta info
            Android P2P will not have id, but will have type
        }}
        <dl>
            {{#if id}}
            <dt>Tag Id</dt>             <dd>{{ bytesToHexString id }}</dd>
            {{/if}}
            
            {{#if type}}
            <dt>Tag Type</dt>           <dd>{{ type }}</dd>
            {{/if}}

            {{#if maxSize }}
            <dt>Max Size</dt>           <dd>{{ maxSize }} bytes</dd>
            {{/if}}            

            {{#if freeSpaceSize }}
            <dt>Free Space</dt>         <dd>{{ freeSpaceSize }} bytes</dd>
            {{/if}}

            {{#if id}}
            <dt>Is Writable</dt>        <dd>{{ toString isWritable }}</dd>
            <dt>Can Make Read Only</dt> <dd>{{ toString canMakeReadOnly }}</dd>
            {{/if}}            
        </dl>

        {{#each ndefMessage}}  {{! does not read well, iterating on records non messages}}
        <div class='record'>
            Record {{ @index }}:<br/>
            TNF: <b>{{ tnfToString tnf }}</b><br/>        
            {{#if tnf}}
                Record Type: <b>{{ bytesToString type }}</b><br/>
                Payload: <b>{{ decodePayload this }}</b><br/>
                {{#if id}}
                    Record Id: <b>{{ bytesToString id }}</b><br/>            
                {{/if}}
            {{/if}}
        </div>
        {{/each}}
    </script>
    
    <script type="text/javascript" charset="utf-8" src="js/handlebars.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/read.js"></script>
    <script type="text/javascript">
        app.initialize();

        function readon(){
            function failure(reason) {
                navigator.notification.alert(reason, function() {}, "There was a problem");
            }
        	
            nfc.addNdefListener(
                    app.onNdef,
                    function() {
                        console.log("Listening for NDEF tags.");
                    },
                    failure
                );
        }
        function readoff(){
/*             function failure(reason) {
                navigator.notification.alert(reason, function() {}, "There was a problem");
            }
            nfc.removeNdefListener(
                    app.onNdef,
                    function() {
                        console.log("--------------No Listening for NDEF tags.");
                    },
                    failure
                );
 */

 function win() {
	    console.log("^^^^^^");
	  }
	  function fail() {
	    alert('Failed to ㅜㅜㅜㅜ');
	  }

	  cordova.exec(win, fail, "NfcPlugin", "removeNdef", []);

            
        
        
        }
        </script>

	<button id="read" onclick="readon();">read on</button>
	<button id="read" onclick="readoff();">read off</button>
        
        <div data-role="header" data-theme="a" data-add-back-btn="true">
			<a href="index.html" data-icon="home" class="ui=btn-left">Main</a>
            <h1>Read Page</h1>
        </div>
    <h1>S-Pet NFC Reader</h1>
    <div id="tagContents">
        <div class="hidden">
            Scan a tag to being.

	       	<img src="img/nfc_logo.png">
            <h1>"휴대폰 뒷면에 S-Pet 태그를 탭해주십시오."</h1>
        </div>
    </div>
</div>
-->
</body>
</html>